import request from '@/utils/request'
const loginUrl = '/login';
const registerUrl = '/register';
const chemaUrl = '/chema';
const roomUrl = '/room';
const movie_typeUrl = '/movie_type';
const movieUrl = '/movie';
const timeUrl = '/time';
const orderUrl = '/order';

export const login = (data) =>
    request.post(loginUrl, data)
export const register = (data) =>
    request.post(registerUrl, data)

export const getCinemaAll = () =>
    request.get(chemaUrl + '/all')
export const getCinemaList = (data) =>
    request.get(chemaUrl, { params: data })
export const getCinema = (data) =>
    request.get(chemaUrl, { params: data })
export const postCinema = (data) =>
    request.post(chemaUrl, data)
export const putCinema = (data) =>
    request.put(chemaUrl, data)
export const delCinema = (data) =>
    request.delete(chemaUrl, { params: data })

export const getRoomList = (data) =>
    request.get(roomUrl, { params: data })
export const getRoom = (data) =>
    request.get(roomUrl, { params: data })
export const postRoom = (data) =>
    request.post(roomUrl, data)
export const putRoom = (data) =>
    request.put(roomUrl, data)
export const delRoom = (data) =>
    request.delete(roomUrl, { params: data })

export const getMovieType = (data) =>
    request.get(movie_typeUrl, data)
export const postMovieType = (data) =>
    request.post(movie_typeUrl, data)
export const putMovieType = (data) =>
    request.put(movie_typeUrl, data)
export const delMovieType = (data) =>
    request.delete(movie_typeUrl, { params: data })

export const getMovie = (data) =>
    request.get(movieUrl, data)
export const postMovie = (data) =>
    request.post(movieUrl, data)
export const putMovie = (data) =>
    request.put(movieUrl, data)
export const delMovie = (data) =>
    request.delete(movieUrl, { params: data })


export const getTime = (data) =>
    request.get(timeUrl, data)
export const postTime = (data) =>
    request.post(timeUrl, data)
export const putTime = (data) =>
    request.put(timeUrl, data)
export const delTime = (data) =>
    request.delete(timeUrl, { params: data })

export const getOrder = (data) =>
    request.get(orderUrl, { params: data })